package service;

import java.util.List;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import dao.GoodsDao;
import po.Goods;
@Service("goodsService")
@Transactional
/**
* @author    韩
* @version   创建时间：2020年12月6日 下午6:35:23
* @Class     18卓工
* @studentid 18130502
*/
public class GoodsServiceImpl implements GoodsService {

	@Autowired
	private GoodsDao goodsDao;
	
	//添加
	public void addGoods(Goods goods) {
		// TODO Auto-generated method stub
		 goodsDao.daoAddGoods(goods);
	}

	public int deleteAGoods(Integer id) {
		// TODO Auto-generated method stub
		return goodsDao.daoDeleteAGoods(id);
	}

	public int deleteGoods(List<Integer> ids) {
		// TODO Auto-generated method stub
		return goodsDao.daoDeleteGoods(ids);
	}

	public Goods selectAgoods(Integer id) {
		// TODO Auto-generated method stub
		return goodsDao.daoSelectAGoods(id);
	}

	public List<Goods> selectGoods() {
		// TODO Auto-generated method stub
		return goodsDao.daoSelectAllGoods();
	}

	public List<Goods> selectGoodsByPage(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return goodsDao.daoSelectGoodsByPage(map);
	}

	public int updateGoods(Goods goods) {
		// TODO Auto-generated method stub
		return goodsDao.daoUpdateAGoods(goods);
	}

	public List<Map<String, Object>> selectCartGoods(Integer id) {
		// TODO Auto-generated method stub
		return goodsDao.daoSelectCartGoods(id);
	}

	public List<Map<String, Object>> selectFocusGoods(Integer id) {
		// TODO Auto-generated method stub
		return goodsDao.daoSelectFocusGoods(id);
	}

	public List<Map<String, Object>> selectOrderGoods(Integer id) {
		// TODO Auto-generated method stub
		return goodsDao.daoSelectOrderGoods(id);
	}

}

